Add creating extension packs when opening the editor#2300
Conversation
| const packPath = join(workspaceFolder.path, matches.groups.name); | ||
| if (await pathExists(packPath)) { | ||
| return `A pack already exists at ${packPath}`; | ||
| } |
There was a problem hiding this comment.
What happens if this path is in a folder that already contains a qlpack (or a qlpack is in a parent folder)? I think we need to check for this case and throw an error.
It's technically possible to do this, but it's confusing and there are some edge cases where problems occur.
There was a problem hiding this comment.
Since this is a simple prototype, I don't think we need to handle this right now. This will almost always create a nested extension pack since the workspace folder is probably codeql-custom-queries-java which is a qlpack. I've added this to a list of problems we need to solve to make this production-ready.
| version: "0.0.0", | ||
| library: true, | ||
| extensionTargets: { | ||
| "codeql/java-all": "*", |
There was a problem hiding this comment.
What happens if someone tries to create an extension pack targeting something besides java?
Either make it explicit in one of the dropdowns that this only works for java, or add a new step where users can choose the language.
There was a problem hiding this comment.
For now, we're only supporting Java in the data extension editor prototype and don't need to support any other languages yet.
There was a problem hiding this comment.
I think that's fine as long as the extension editor clearly states that this only works for Java. (Maybe this already exists...I haven't reviewed that part yet.)
There was a problem hiding this comment.
We don't have that yet, but it will be made clear to the users we're releasing this to and we'll be adding C# support before doing that anyway, so then this will change to codeql/${databaseItem.language}-all.
aeisenberg
left a comment
There was a problem hiding this comment.
Looks good. See my comment for some sort of disclaimer to add to the extension editor.
| version: "0.0.0", | ||
| library: true, | ||
| extensionTargets: { | ||
| "codeql/java-all": "*", |
There was a problem hiding this comment.
I think that's fine as long as the extension editor clearly states that this only works for Java. (Maybe this already exists...I haven't reviewed that part yet.)
This adds the ability to create a new extension pack when opening the data extension editor. It lets the user select a workspace folder and package name, but does not currently allow selecting the actual directory where it will be saved. For now, this is always in a subfolder of the workspace folder.
Screen.Recording.2023-04-12.at.14.56.36.mov
Based on #2296
Checklist
ready-for-doc-reviewlabel there.